<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>


<script>
    //工资数组中[1500,1200,2000,2100,1800]把工资大于2000的删除
    var arr = [1500,1200,2000,2100,1800]; console.log(arr);
    var newArr = arr.filter(function(element,index,arr){
        if ( element > 2000 ) {
            return false;
        }
        return true;
    });
    console.log( newArr );


</script>

</body>
</html>